package com.mjk.common.core.jdbc.transaction.annotation;

import org.springframework.core.annotation.AliasFor;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.lang.annotation.*;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Transactional
public @interface BeeTransactional {
	/**
	 * 默认开启事务的连接池名称
     */
	String dataBaseId() default "his";
	/**
	 * 事务超时时间(如果设置值，可以预防ALT+F4强制关闭)
     */
	@AliasFor(annotation=Transactional.class,attribute="timeout")
	int timeout() default TransactionDefinition.TIMEOUT_DEFAULT;
	/**
	 * 事务传播机制
     */
	@AliasFor(annotation=Transactional.class,attribute="propagation")
	Propagation propagation() default Propagation.REQUIRED;
}
